
    <!-- List of IAM policies referring a given bucket -->
    <script id="services.s3.bucket_iam_policies.partial" type="text/x-handlebars-template">
        {{#if resource_type}}
          <div class="list-group-item">
            <div class="accordion">
              <h4 class="list-group-item-heading accordion-heading">{{makeTitle resource_type}} with access via IAM policies</h4>
              <div id="s3_iam_{{resource_type}}_policies_details-{{escape_special_chars ../name}}" class="accordion-body item-margin">
                <div class="accordion-inner">
                  <table class="table-striped" width="100%" >
                    <tr>
                      <td width="40%">{{makeTitle ../resource_type}} name</td>
                      <td width="40%" class="text-center">Policy name</td>
                      <td width="20%" class="text-center">Condition?</td>
                    </tr>
                    {{#each (lookup . resource_type)}}
                      {{#each policies}}
                        <tr>
                        <td width="40%"><a href="javascript:showObject('services.iam.{{../../resource_type}}.{{@../key}}')">
                          {{getValueAt 'services.iam' ../../resource_type @../key 'name'}}
                        </a></td>
                        <td width="40%" class="text-center">
                          <a href="javascript:showIAMManagedPolicy('{{@key}}')">{{getValueAt 'services.iam.policies' @key 'name'}}</a>
                        </td>
                        <td width="20%" class="text-center">
                          {{has_condition  this}}
                        </td>
                        </tr>
                      {{/each}}
                      {{#each inline_policies}}
                        <tr>
                        <td width="40%"><a href="javascript:showObject('services.iam.{{../../resource_type}}.{{@../key}}')">
                          {{getValueAt 'services.iam' ../../resource_type @../key 'name'}}
                        </a></td>
                        <td width="40%" class="text-center">
                          <a href="javascript:showIAMInlinePolicy('{{../../resource_type}}', '{{@../key}}', '{{@key}}')">
                            {{getValueAt 'services.iam' ../../resource_type @../key 'inline_policies' @key 'name'}}
                          </a>
                        </td>
                        <td width="20%" class="text-center">
                          {{has_condition  this}}
                        </td>
                        </tr>
                      {{/each}}
                    {{/each}}
                  </table>
                </div>
              </div>
            </div>
          </div>
        {{/if}}
    </script>
    <script>
        Handlebars.registerPartial("services.s3.bucket_iam_policies", $("#services\\.s3\\.bucket_iam_policies\\.partial").html());
    </script>
